import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "dbshop018_商品管理商品属性属性分组"

# 1.点击“删除”按钮，确认删除，删除成功。

firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性分组')

# 1.点击“删除”按钮，确认删除，删除成功。
firefox.find_element_by_xpath('//td[contains(.,"好好学习")]/following-sibling::td[2]/a[2]').click()
firefox.switch_to.alert.accept()
time.sleep(2)

try:
    firefox.find_element_by_xpath('//td[contains(.,"好好学习")]').is_displayed()
    writeLog("%s 删除失败" % testCase)
except:
    writeLog("%s 删除成功" % testCase)
    getPhoto(firefox)
firefox.quit()


